<?php
class CheckVip extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		$me = check_login ( ADMIN_LOGIN_PAGE );
		$type = rqst ( 'type', 'account' );
		$userModel = new VipUserModel ();
		$data ['uid'] = irqst ( 'uid', 0 );
		if ($type == 'account') {
			$data ['account'] = $value = rqst ( 'account' );
			$data ['old_account'] = rqst ( 'oact', '' );
			$rst = $userModel->check_uname ( $value, $data );
		} else {
			$data ['email'] = $value = rqst ( 'email' );
			$data ['old_email'] = rqst ( 'omail', '' );
			$rst = $userModel->check_email ( $value, $data );
		}
		@header ( 'Content-type: application/json', true );
		echo $rst === true ? 'true' : 'false';
	}
}